const Menu = require("electron").Menu;
const BrowserWindow = require("electron").BrowserWindow;
let template = [{
  label: "广西",
  submenu: [{
    label: "玉林",
    // 增加快捷键
    accelerator: "ctrl+n",
    async click() {
      let win = new BrowserWindow({
        width: 500,
        hight: 300,
        webPreferences: {
          nodeIntegration: true
        }
      });
      win.loadFile("./page/yellow.html");
      win.on("closed", async () => {
        win = null;
      })
    },
  }, {
    label: "南宁"
  }],
}, {
  label: "浙江",
  submenu: [{
    label: "杭州"
  }, {
    label: "温州"
  }]
}, {
  label: "湖南",
  submenu: [{
    label: "长沙"
  }, {
    label: "衡阳"
  }]
}];
let moban = Menu.buildFromTemplate(template);
Menu.setApplicationMenu(moban);